package com.dhwl.hsh.merchant.model.impl;

import com.dhwl.hsh.lib.api.ApiManager;
import com.dhwl.hsh.lib.bean.HttpResponse;
import com.dhwl.hsh.lib.bean.resp.AreaResp;
import com.dhwl.hsh.lib.bean.resp.BannerResponse;
import com.dhwl.hsh.lib.bean.resp.CarTypeResp;
import com.dhwl.hsh.lib.bean.resp.HtmlUrlResp;
import com.dhwl.hsh.merchant.model.ICommonModel;

import java.util.List;

import rx.Observable;

/**
 * 简要描述
 *
 * @author Derek.Kidd
 * @version V1.0.0
 * @date 2016-04-13 15:42
 */
public class CommonModel implements ICommonModel {


    private CommonModel() {
    }

    public static final CommonModel instance = new CommonModel();

    public static CommonModel getInstance() {
        return instance;
    }

    @Override
    public Observable<HttpResponse<String>> getVCode(String phone, int type) {
        return ApiManager.getInstance().getCommonApi().getSMS(phone, type);
    }


    @Override
    public Observable<HttpResponse<List<CarTypeResp>>> getCarType() {
        return ApiManager.getInstance().getCommonApi().getCarType();
    }


    @Override
    public Observable<HttpResponse<List<BannerResponse>>> getBanner() {
        return ApiManager.getInstance().getCommonApi().getBanner();
    }

    @Override
    public Observable<HttpResponse<HtmlUrlResp>> getHtmlUrl() {
        return ApiManager.getInstance().getCommonApi().getHtmlUrl();
    }

    @Override
    public Observable<HttpResponse<List<AreaResp>>> getArea() {
        return ApiManager.getInstance().getCommonApi().getArea();
    }

}
